function(require, module, exports, window, document, frames, self, location, navigator, localStorage, history, Caches, screen, alert, confirm, prompt, XMLHttpRequest, WebSocket, Reporter, webkit, WeixinJSCore) {

    "use strict";
    function o(o, e) {
        if (! (o instanceof e)) throw new TypeError("Cannot call a class as a function")
    }
    function e(o, e) {
        if (!o) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return ! e || "object" != typeof e && "function" != typeof e ? o: e
    }
    function t(o, e) {
        if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function, not " + typeof e);
        o.prototype = Object.create(e && e.prototype, {
            constructor: {
                value: o,
                enumerable: !1,
                writable: !0,
                configurable: !0
            }
        }),
        e && (Object.setPrototypeOf ? Object.setPrototypeOf(o, e) : o.__proto__ = e)
    }
    var r = function() {
        function o(o, e) {
            for (var t = 0; t < e.length; t++) {
                var r = e[t];
                r.enumerable = r.enumerable || !1,
                r.configurable = !0,
                "value" in r && (r.writable = !0),
                Object.defineProperty(o, r.key, r)
            }
        }
        return function(e, t, r) {
            return t && o(e.prototype, t),
            r && o(e, r),
            e
        }
    } (),
    n = require("../../../../utils/base"),
    i = require("../../../../utils/log"),
    s = getApp(),
    a = new i.Log,
    d = require("../../../../utils/utils"),
    u = function(i) {
        function u() {
            o(this, u);
            var t = e(this, (u.__proto__ || Object.getPrototypeOf(u)).call(this));
            return t.studyIndex = 0,
            t.studiedCount = 0,
            t.wordsList = [],
            t
        }
        return t(u, n.Base),
        r(u, [{
            key: "loadGroupWordsList",
            value: function() {
                var o = this,
                e = [],
                t = s.globalData.taskWordsList;
                return new Promise(function(r) {
                    for (var n = 0; n < t.length; n++) {
                        if (t[n].know <= 0 && e.push(t[n]), 7 == e.length) {
                            o.wordsList = e,
                            r(o.wordsList);
                            break
                        }
                        if (n == t.length - 1) {
                            o.wordsList = e,
                            r(o.wordsList);
                            break
                        }
                        if (t[n].wordType != t[n + 1].wordType && 0 != e.length) {
                            o.wordsList = e,
                            r(o.wordsList);
                            break
                        }
                        o.wordsList = e
                    }
                    r(o.wordsList)
                })
            }
        },
        {
            key: "getWordDetail",
            value: function(o) {
                var e = this;
                return new Promise(function(t) {
                    wx.getStorage({
                        key: o.wordId,
                        success: function(o) {
                            t(o.data)
                        },
                        fail: function(r) {
                            var n = "/bookmanage/wordplus/" + s.globalData.bookId + "/" + o.wordId + ".txt";
                            e.getCDNFile(n).then(function(r) {
                                if ("fail" == r) t("fail");
                                else {
                                    var n = e.dealWordDetail(JSON.parse(r.data));
                                    wx.setStorage({
                                        data: n,
                                        key: o.wordId
                                    }),
                                    t(e.dealWordDetail(JSON.parse(r.data)))
                                }
                            })
                        }
                    })
                })
            }
        },
        {
            key: "getStudyWord",
            value: function() {
                var o = this,
                e = this;
                return a.info(this.studyIndex),
                new Promise(function(t) {
                    e.studyIndex == e.wordsList.length ? (t("groupSummary"), o.studyIndex = 0) : t(e.wordsList[e.studyIndex])
                })
            }
        },
        {
            key: "updateStudyWordStatus",
            value: function() {
                var o = this;
                return this.studyIndex++,
                new Promise(function(e) {
                    o.getStudyWord().then(function(o) {
                        e(o)
                    })
                })
            }
        },
        {
            key: "dealWordDetail",
            value: function(o) {
                if (o.bookWordInfo.bookWordExamples) for (e = 0; e < o.bookWordInfo.bookWordExamples.length; e++) o.bookWordInfo.bookWordExamples[e].enSentences = d.findWord(o.bookWordInfo.bookWordExamples[e].enSentences, o.bookWordInfo.wordName);
                if (o.bookWordInfo.bookWordExams) for (var e = 0; e < o.bookWordInfo.bookWordExams.length; e++) o.bookWordInfo.bookWordExams[e].enSentences = d.findWord(o.bookWordInfo.bookWordExams[e].enSentences, o.bookWordInfo.wordName);
                return o.bookWordInfo.bookWordMnemonics && (o.bookWordInfo.bookWordMnemonics = d.dealMemory(o.bookWordInfo.bookWordMnemonics, o.bookWordInfo.wordName)),
                o
            }
        },
        {
            key: "getWordVoice",
            value: function(o) {
                var e = this,
                t = "/FY/EN/" + o + ".mp3",
                r = e.getFileToken(t).sign,
                n = e.getFileToken(t).timestamp;
                return e.cosFilePathPrefix + "/FY/EN/" + o + ".mp3?sign=" + r + "&t=" + n
            }
        },
        {
            key: "getWordVideo",
            value: function(o) {
                var e = this,
                t = "/bookmanage/video/" + o + ".mp4",
                r = e.getFileToken(t).sign,
                n = e.getFileToken(t).timestamp;
                return e.cosFilePathPrefix + "/bookmanage/video/" + o + ".mp4?sign=" + r + "&t=" + n
            }
        }]),
        u
    } ();
    module.exports = {
        Group: u
    };
}